<%= render partial: "collections/collection", collection: collections %>

<% if page_feed.present? %>
    <%= content_tag :li, class: "collection-pages collection-source", data: {feed_id: page_feed.id, behavior: "keyboard_navigable" } do %>
        <%= render Common::FeedLink.new(feed: page_feed, link: pages_feed_path(page_feed), behavior: "selectable show_entries open_item feed_link") do %>
            <span class="link-inner">
                <%= render FaviconComponent.new(feed: page_feed) %>
                <span class="collection-label-wrap" >
                    <span class="collection-label">Pages</span>
                </span>
                <span class="count-wrap">
                    <%= content_tag :span, "", class: "count", data: {behavior: "needs_count", count_group: "byFeed", count_group_id: page_feed.id} %>
                </span>
            </span>
        <% end %>
    <% end %>
<% end %>

<% if saved_searches.present? %>
    <li class="source-section section-saved-searches">
        Searches
    </li>
    <%= render partial: "saved_searches/saved_search", collection: saved_searches %>
<% end %>

<% if tags.present? %>
  <% cache [tags, tags.map(&:user_feeds), "v9"] do %>
    <li class="source-section section-tags">
        Tags
    </li>
    <%= render partial: "tags/tag", collection: tags %>
  <% end %>
<% end %>

<% if feeds.present? %>
  <% cache [feeds, "v3"] do %>
      <li class="source-section section-feeds">
          Feeds
      </li>
      <%= render Common::FeedsList.new(feeds: feeds) %>
  <% end %>
<% end %>

<script>
  feedbin.formatFeeds();
</script>

